package com.benyanyi.loglib

import android.text.TextUtils

/**
 * @author myLove
 * @date 2022/11/30 13:21
 * @email ben@yanyi.red
 * @overview
 */
class LogConfig {
    internal var nullTip = "Log with null object" //为空时提示信息
        private set
    internal var tagDefault = "Jlog" //默认标签
        private set
    internal var tag: String? = null  //标签
        private set
    internal var isShowLog = false //是否显示log
        private set
    internal var isWrite = false //是否写入文件夹
        private set
    internal var writeRootPath = "" //写入文件夹根目录
        private set
    internal var isShowWrite = false //是否显示log的时候也写入文件夹
        private set

    fun setNullTip(nullTip: String): LogConfig {
        this.nullTip = nullTip
        return this
    }

    fun setTagDefault(tagDefault: String): LogConfig {
        this.tagDefault = tagDefault
        return this
    }

    fun setTag(mTag: String?): LogConfig {
        tag = mTag
        Jlog.mIsGlobalTagEmpty = TextUtils.isEmpty(mTag)
        return this
    }

    fun setShowLog(showLog: Boolean): LogConfig {
        isShowLog = showLog
        return this
    }

    fun setWrite(write: Boolean): LogConfig {
        isWrite = write
        return this
    }

    fun setWriteRootPath(writeRootPath: String): LogConfig {
        this.writeRootPath = writeRootPath
        return this
    }

    fun setShowWrite(showWrite: Boolean): LogConfig {
        isShowWrite = showWrite
        return this
    }
}